import 'package:flutter/material.dart';

void main() {
  runApp(const _MyApp());
}

class _MyApp extends StatelessWidget {
  const _MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "Flutter Baseline",
      theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
          useMaterial3: true),
      home: const _MyHomePage(),
    );
  }
}

class _MyHomePage extends StatefulWidget {
  const _MyHomePage({super.key});

  @override
  State<StatefulWidget> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<_MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Baseline Demo"),
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
      ),
      body: Container(
          padding: const EdgeInsets.only(left: 20.0, right: 20.0),
          child: const Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Baseline(
                baseline: 100.0,
                baselineType: TextBaseline.alphabetic,
                child: Text(
                  "今天天气真好",
                  style: TextStyle(
                      fontSize: 18.0, textBaseline: TextBaseline.alphabetic),
                ),
              ),
              Baseline(
                baseline: 100.0,
                baselineType: TextBaseline.alphabetic,
                child: Text(
                  "适合晨练",
                  style: TextStyle(
                      fontSize: 30.0, textBaseline: TextBaseline.alphabetic),
                ),
              ),
              Baseline(
                baseline: 100.0,
                baselineType: TextBaseline.alphabetic,
                child: FlutterLogo(
                  size: 100,
                ),
              )
            ],
          )),
    );
  }
}
